package com.konsung.ksdc.config;

import com.konsung.ksdc.bean.netbean.RegisterUserNetBean;

/**
 * Created by Administrator on 2016/3/8 0008.
 */
public class NetConfig {
    public static final String PROTOCOL_SCHAME = "http://";
    public static String currentEmpid = ""; //当前登录的用户 EMPID(用户唯一标识)
    public static RegisterUserNetBean currentUser; // 当前登录用户

    public static String serverIP = "ox.konsung.net"; //公网
    //    public static String serverIP = "192.168.0.184"; //内网服务器
    public static String port = "5555";

    public static String picUrl = getServerUrl() + "ksdc-web/" +
            "download/downloadImage?fileName=";
    //    public static String picUrl = "http://192.168.0.184:5555/ksdc-web/" +
//            "download/downloadImage?fileName="; //内网
//
//    public static String mqttSserverIp = "192.168.0.184"; //mqtt内网
    public static String mqttSserverIp = serverIP; //mqtt公网

    /**
     * @return 拼接服务器地址
     */
    public static String getServerUrl() {
        return "http://" + serverIP + ":" + getPort() + "/";
    }

    /**
     * @return 获取 端口字符串
     */
    public static String getPort() {
        return port;
    }

    /**
     * @return 拼接服务器中本应用的地址
     */
    public static String getRootUrl() {
        return getServerUrl() + "ksdc-web/";
    }

    /**
     * @return 拼接本应用中app文件夹地址
     */
    public static String getBasicUrl() {
        return getRootUrl() + "app/";
    }

    /**
     * 获取消息推送路径
     * @param id 键
     * @return 路径
     */
    public static String getImPushUrl(String id) {
        return getBasicUrl() + "findImMessageById?id=" + id;
    }
}
